package secondriver.springsubway.example.rpv.demo;

import net.sf.oval.constraint.NotEmpty;
import net.sf.oval.constraint.NotNull;
import net.sf.oval.constraint.Range;

/**
 * Created by ZhangXiao on 2015/6/11.
 */
public class UserParameter {

    @NotNull(errorCode = "UserParameter.name", message = "UserParameter.name.violated")
    @NotEmpty(errorCode = "UserParameter.name", message = "UserParameter.name.violated")
    private String name;

    @Range(min = 0, max = 120, errorCode = "UserParameter.age", message = "UserParameter.age.violated")
    private int age;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "UserParameter{" +
                "name='" + name + '\'' +
                ", age='" + age + '\'' +
                '}';
    }
}
